home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / acos.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.2 KB  |  49 lines

  1. <!--- This example shows how to use ACos --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. ACos Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  12.  
  13. <BODY  bgcolor="#FFFFD5">
  14.  
  15. <H3>ACos Example</H3>
  16.  
  17. <!--- output its arccosine value --->
  18. <CFIF IsDefined("form.CosNum")>
  19.     <CFIF IsNumeric(form.CosNum)>
  20.         <CFIF form.CosNum LESS THAN OR EQUAL TO 1>
  21.             <CFIF form.CosNum GREATER THAN OR EQUAL TO -1>
  22.                 ACos(<CFOUTPUT>#form.CosNum#</CFOUTPUT>) = <CFOUTPUT>#ACos(form.cosNum)# Radians</CFOUTPUT>
  23.                 <BR>
  24.                 or
  25.                 <BR>
  26.                 ACos(<CFOUTPUT>#form.CosNum#</CFOUTPUT>) = <CFOUTPUT>#Evaluate(ACos(form.cosNum) * 180/PI())# Degrees</CFOUTPUT>
  27.             <CFELSE>
  28. <!--- if it is empty, output an error message --->
  29.             <H4>Please enter a number between -1 and 1</H4>
  30.             </CFIF>
  31.         <CFELSE>
  32. <!--- if it is empty, output an error message --->
  33.         <H4>Please enter a number between -1 and 1</H4>
  34.         </CFIF>
  35.     </CFIF>        
  36. </CFIF>
  37.  
  38. <FORM ACTION="acos.cfm" METHOD="POST">
  39. <P>Type in a number to get its arccosine in Radians and Degrees.
  40. <BR><INPUT TYPE="Text" NAME="cosNum" SIZE="25">
  41.  
  42. <P><INPUT TYPE="Submit" NAME=""> <INPUT TYPE="RESET">
  43.  
  44. </FORM>
  45.  
  46. </BODY>
  47.  
  48. </HTML>       
  49.